package com.free.framework.ui;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.free.framework.R;
import com.free.ui.widget.FengjrLoadingView;

/**
 * @author 李博
 * @date 2016年11月03日
 * @desc
 */
public class DlgFactory {

    public static Dialog createProgressDlg(Context context) {
        View v = LayoutInflater.from(context).inflate(R.layout.stock_new_dlg_loading_view, null);
//        final FengjrLoadingView fengjrLoadingView = (FengjrLoadingView) v.findViewById(R.id.fengjr_loading);
        Dialog dialog = new Dialog(context, R.style.Dialog_Transparent);
        dialog.setCancelable(true);
        dialog.setContentView(v, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        dialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialog) {
//                fengjrLoadingView.startAnimation();
            }
        });
        dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
//                fengjrLoadingView.stopAnimation();
            }
        });
        return dialog;
    }
}
